<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>std.stdio</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "std.stdio";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/std.stdio.html" class="symbol">std.stdio</a></h1>
  
<div class="summary">Standard I/O functions that extend <b>std.c.stdio</b>.
 <b>std.c.stdio</b> is automatically imported when importing
 <b>std.stdio</b>.</div>
<dl>
<dt class="decl">int <a class="symbol _function" name="fputc_unlocked" href="./htmlsrc/std.stdio.html#L79" kind="function" beg="79" end="79">fputc_unlocked</a><span class="params">(int, FILE*)</span>; <span class="attrs">[<span class="linkg">extern(C)</span>]</span> <a title="Permalink to this symbol" href="#fputc_unlocked" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L79">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">int <a class="symbol _function" name="fputwc_unlocked" href="./htmlsrc/std.stdio.html#L80" kind="function" beg="80" end="80">fputwc_unlocked</a><span class="params">(wchar_t, FILE*)</span>; <span class="attrs">[<span class="linkg">extern(C)</span>]</span> <a title="Permalink to this symbol" href="#fputwc_unlocked" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L80">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">int <a class="symbol _function" name="fgetc_unlocked" href="./htmlsrc/std.stdio.html#L81" kind="function" beg="81" end="81">fgetc_unlocked</a><span class="params">(FILE*)</span>; <span class="attrs">[<span class="linkg">extern(C)</span>]</span> <a title="Permalink to this symbol" href="#fgetc_unlocked" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L81">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">int <a class="symbol _function" name="fgetwc_unlocked" href="./htmlsrc/std.stdio.html#L82" kind="function" beg="82" end="82">fgetwc_unlocked</a><span class="params">(FILE*)</span>; <span class="attrs">[<span class="linkg">extern(C)</span>]</span> <a title="Permalink to this symbol" href="#fgetwc_unlocked" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L82">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">void <a class="symbol _function" name="flockfile" href="./htmlsrc/std.stdio.html#L83" kind="function" beg="83" end="83">flockfile</a><span class="params">(FILE*)</span>; <span class="attrs">[<span class="linkg">extern(C)</span>]</span> <a title="Permalink to this symbol" href="#flockfile" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L83">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">void <a class="symbol _function" name="funlockfile" href="./htmlsrc/std.stdio.html#L84" kind="function" beg="84" end="84">funlockfile</a><span class="params">(FILE*)</span>; <span class="attrs">[<span class="linkg">extern(C)</span>]</span> <a title="Permalink to this symbol" href="#funlockfile" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L84">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">ssize_t <a class="symbol _function" name="getline" href="./htmlsrc/std.stdio.html#L85" kind="function" beg="85" end="85">getline</a><span class="params">(char**, size_t*, FILE*)</span>; <span class="attrs">[<span class="linkg">extern(C)</span>]</span> <a title="Permalink to this symbol" href="#getline" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L85">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">ssize_t <a class="symbol _function" name="getdelim" href="./htmlsrc/std.stdio.html#L86" kind="function" beg="86" end="86">getdelim</a><span class="params">(char**, size_t*, int, FILE*)</span>; <span class="attrs">[<span class="linkg">extern(C)</span>]</span> <a title="Permalink to this symbol" href="#getdelim" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L86">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">alias fputc_unlocked <a class="symbol _alias" name="FPUTC" href="./htmlsrc/std.stdio.html#L89" kind="alias" beg="89" end="89">FPUTC</a>; <a title="Permalink to this symbol" href="#FPUTC" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L89">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">alias fputwc_unlocked <a class="symbol _alias" name="FPUTWC" href="./htmlsrc/std.stdio.html#L90" kind="alias" beg="90" end="90">FPUTWC</a>; <a title="Permalink to this symbol" href="#FPUTWC" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L90">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">alias fgetc_unlocked <a class="symbol _alias" name="FGETC" href="./htmlsrc/std.stdio.html#L91" kind="alias" beg="91" end="91">FGETC</a>; <a title="Permalink to this symbol" href="#FGETC" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L91">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">alias fgetwc_unlocked <a class="symbol _alias" name="FGETWC" href="./htmlsrc/std.stdio.html#L92" kind="alias" beg="92" end="92">FGETWC</a>; <a title="Permalink to this symbol" href="#FGETWC" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L92">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">alias flockfile <a class="symbol _alias" name="FLOCK" href="./htmlsrc/std.stdio.html#L94" kind="alias" beg="94" end="94">FLOCK</a>; <a title="Permalink to this symbol" href="#FLOCK" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L94">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">alias funlockfile <a class="symbol _alias" name="FUNLOCK" href="./htmlsrc/std.stdio.html#L95" kind="alias" beg="95" end="95">FUNLOCK</a>; <a title="Permalink to this symbol" href="#FUNLOCK" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L95">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">class <a class="symbol _class" name="StdioException" href="./htmlsrc/std.stdio.html#L106" kind="class" beg="106" end="137">StdioException</a> : Exception; <a title="Permalink to this symbol" href="#StdioException" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L106">#</a></dt>
<dd class="ddef">
<div class="summary">Thrown if I/O errors happen.</div>
<dl>
<dt class="decl">uint <a class="symbol _variable" name="StdioException.errno" href="./htmlsrc/std.stdio.html#L108" kind="variable" beg="108" end="108">errno</a>; <a title="Permalink to this symbol" href="#StdioException.errno" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L108">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl"><a class="symbol _ctor" name="StdioException.this" href="./htmlsrc/std.stdio.html#L110" kind="ctor" beg="110" end="113">this</a><span class="params">(char[] <em>msg</em>)</span>; <a title="Permalink to this symbol" href="#StdioException.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L110">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl"><a class="symbol _ctor" name="StdioException.this:2" href="./htmlsrc/std.stdio.html#L115" kind="ctor" beg="115" end="126">this</a><span class="params">(uint <em>errno</em>)</span>; <a title="Permalink to this symbol" href="#StdioException.this:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L115">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">void <a class="symbol _function" name="StdioException.opCall" href="./htmlsrc/std.stdio.html#L128" kind="function" beg="128" end="131">opCall</a><span class="params">(char[] <em>msg</em>)</span>; <span class="attrs">[<span class="stc">static</span>]</span> <a title="Permalink to this symbol" href="#StdioException.opCall" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L128">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">void <a class="symbol _function" name="StdioException.opCall:2" href="./htmlsrc/std.stdio.html#L133" kind="function" beg="133" end="136">opCall</a><span class="params">()</span>; <span class="attrs">[<span class="stc">static</span>]</span> <a title="Permalink to this symbol" href="#StdioException.opCall:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L133">#</a></dt>
<dd class="ddef"></dd></dl></dd>
<dt class="decl">void <a class="symbol _function" name="writefx" href="./htmlsrc/std.stdio.html#L140" kind="function" beg="140" end="210">writefx</a><span class="params">(FILE* <em>fp</em>, TypeInfo[] <em>arguments</em>, void* <em>argptr</em>, int <em>newline</em> = false)</span>; <span class="attrs">[<span class="prot">private</span>]</span> <a title="Permalink to this symbol" href="#writefx" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L140">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">void <a class="symbol _function" name="writef" href="./htmlsrc/std.stdio.html#L219" kind="function" beg="219" end="222">writef</a><span class="params">(...)</span>; <a title="Permalink to this symbol" href="#writef" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L219">#</a></dt>
<dd class="ddef">
<div class="summary">Arguments are formatted per the
 <a href="std_format.html#format-string">format strings</a>
 and written to <b>stdout</b>.</div></dd>
<dt class="decl">void <a class="symbol _function" name="writefln" href="./htmlsrc/std.stdio.html#L229" kind="function" beg="229" end="232">writefln</a><span class="params">(...)</span>; <a title="Permalink to this symbol" href="#writefln" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L229">#</a></dt>
<dd class="ddef">
<div class="summary">Same as <b>writef</b>, but a newline is appended
 to the output.</div></dd>
<dt class="decl">void <a class="symbol _function" name="fwritef" href="./htmlsrc/std.stdio.html#L239" kind="function" beg="239" end="242">fwritef</a><span class="params">(FILE* <em>fp</em>, ...)</span>; <a title="Permalink to this symbol" href="#fwritef" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L239">#</a></dt>
<dd class="ddef">
<div class="summary">Same as <b>writef</b>, but output is sent to the
 stream fp instead of <b>stdout</b>.</div></dd>
<dt class="decl">void <a class="symbol _function" name="fwritefln" href="./htmlsrc/std.stdio.html#L249" kind="function" beg="249" end="252">fwritefln</a><span class="params">(FILE* <em>fp</em>, ...)</span>; <a title="Permalink to this symbol" href="#fwritefln" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L249">#</a></dt>
<dd class="ddef">
<div class="summary">Same as <b>writefln</b>, but output is sent to the
 stream fp instead of <b>stdout</b>.</div></dd>
<dt class="decl">char[] <a class="symbol _function" name="readln" href="./htmlsrc/std.stdio.html#L277" kind="function" beg="277" end="282">readln</a><span class="params">(FILE* <em>fp</em> = stdin)</span>; <a title="Permalink to this symbol" href="#readln" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L277">#</a></dt>
<dd class="ddef">
<div class="summary">Read line from stream fp.</div>
<p class="sec_header">Returns:</p>null for end of file,
	char[] for line read from fp, including terminating '\n'
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>fp</em></td><td>input stream</td></tr></table>
<p class="sec_header">Throws:</p><b>StdioException</b> on error
<p class="sec_header">Example:</p>Reads <b>stdin</b> and writes it to <b>stdout</b>.
<pre class="d_code">
<span class="k">import</span> <span class="i">std</span>.<span class="i">stdio</span>;

<span class="k">int</span> <span class="i">main</span>()
{
    <span class="k">char</span>[] <span class="i">buf</span>;
    <span class="k">while</span> ((<span class="i">buf</span> = <span class="i">readln</span>()) != <span class="k">null</span>)
	<span class="i">writef</span>(<span class="sl">"%s"</span>, <span class="i">buf</span>);
    <span class="k">return</span> <span class="n">0</span>;
}
</pre></dd>
<dt class="decl">size_t <a class="symbol _function" name="readln:2" href="./htmlsrc/std.stdio.html#L314" kind="function" beg="314" end="549">readln</a><span class="params">(FILE* <em>fp</em>, inout char[] <em>buf</em>)</span>; <a title="Permalink to this symbol" href="#readln:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L314">#</a></dt>
<dt class="decl">size_t <a class="symbol _function" name="readln:3" href="./htmlsrc/std.stdio.html#L552" kind="function" beg="552" end="555">readln</a><span class="params">(inout char[] <em>buf</em>)</span>; <a title="Permalink to this symbol" href="#readln:3" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.stdio.html#L552">#</a></dt>
<dd class="ddef">
<div class="summary">Read line from stream fp and write it to buf[],
 including terminating '\n'.</div>
This is often faster than readln(FILE*) because the buffer
 is reused each call. Note that reusing the buffer means that
 the previous contents of it need to be copied if needed.
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>fp</em></td><td>input stream</td></tr>
<tr><td><em>buf</em></td><td>buffer used to store the resulting line data. buf
		is resized as necessary.</td></tr></table>
<p class="sec_header">Returns:</p>0 for end of file, otherwise
	number of characters read
<p class="sec_header">Throws:</p><b>StdioException</b> on error
<p class="sec_header">Example:</p>Reads <b>stdin</b> and writes it to <b>stdout</b>.
<pre class="d_code">
<span class="k">import</span> <span class="i">std</span>.<span class="i">stdio</span>;

<span class="k">int</span> <span class="i">main</span>()
{
    <span class="k">char</span>[] <span class="i">buf</span>;
    <span class="k">while</span> (<span class="i">readln</span>(<span class="i">stdin</span>, <span class="i">buf</span>))
	<span class="i">writef</span>(<span class="sl">"%s"</span>, <span class="i">buf</span>);
    <span class="k">return</span> <span class="n">0</span>;
}
</pre></dd></dl>
</div>
<div id="footer">
  <p>Copyright © 1999-2008 by Digital Mars ®, All Rights Reserved.</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 03:40:10 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>